package exception;

public class FinallyDemo {
    public static void main(String[] args) {
        System.out.println("程序开始");

        try{


            String name = "";
            System.out.println(name.length());//正确

            String name2 = "";
            System.out.println(name.length());//出错

            String name1="";
            System.out.println(name1.charAt(0));//出错

        }catch (Exception e) {
            System.out.println("程序出错，");
        }finally {
            System.out.println("最终都会执行我！别想错过我！");
        }
        System.out.println("程序结束！！！");

    }
}
